import request from '@/utils/request'

// id查询题目
export function getQuesById(id) {
  return request({
    url: '/buss/ques/base/get/' + id,
    method: 'get'
  })
}
// 保存题目
export function saveQues(data) {
  return request({
    url: '/buss/ques/base/save',
    method: 'post',
    data: data
  })
}

// 删除题目
export function deleteQues(id) {
  return request({
    url: '/buss/ques/base/delete',
    method: 'delete',
    data: {ids:[id]}
  })
}
// id批量查询题目
export function getQuesBatch(ids) {
  return request({
    url: '/buss/ques/base/getByIds',
    method: 'post',
    data: {
      ids:ids
    }
  })
}
// id查询试卷
export function getPaperById(paperId) {
  return request({
    url: '/buss/paper/get/' + paperId,
    method: 'get'
  })
}
// 保存试卷
export function savePaper(data) {
  return request({
    url: '/buss/paper/save',
    method: 'post',
    data: data
  })
}
// 发布试卷
export function releasePaper(ids) {
  return request({
    url: '/buss/paper/release',
    method: 'post',
    data: { ids: ids }
  })
}
// 删除试卷
export function deletePaper(ids) {
  return request({
    url: '/buss/paper/delete',
    method: 'delete',
    data: { ids: ids }
  })
}
// 下载试卷
export function downloadPaper(paperId) {
  return request({
    url: '/buss/paper/download',
    method: 'get',
    responseType: 'blob',
    params: { paperId: paperId }
  })
}
// 导入试卷
export function importPaper(fileId) {
  return request({
    url: '/buss/paper/import',
    method: 'post',
    params: { fileId: fileId }
  })
}

// id查询考试
export function getExamById(examId) {
  return request({
    url: '/buss/exam/get/' + examId,
    method: 'post',
  })
}
// 保存考试
export function saveExam(data) {
  return request({
    url: '/buss/exam/save',
    method: 'post',
    data: data
  })
}
// 删除考试
export function deleteExam(ids) {
  return request({
    url: '/buss/exam/delete',
    method: 'post',
    data: {ids:ids}
  })
}
// 查询考试科目
export function getExamSubject(examId,paperId) {
  return request({
    url: '/buss/exam/getExamSubject',
    method: 'post',
    params: {examId:examId,paperId:paperId}
  })
}

// 发布考试
export function releaseExam(data) {
  return request({
    url: '/buss/exam/release',
    method: 'post',
    data: data
  })
}
// 开始考试
export function startExam(examId) {
  return request({
    url: '/buss/exam/start',
    method: 'post',
    data: {id:examId}
  })
}

